<template>
  <div>
      <figure class="hover_menu">
        <img src="https://picsum.photos/id/1060/800/480.jpg"/>
        <div>
            <a href="#">Home</a>
            <a href="#">Pricing</a>
            <a href="#">About</a>
        </div>
      </figure>
  </div>
</template>

<script>
export default {
  name: 'MenuOnImageHover'
}
</script>

<style lang="less" scoped>
.hover_menu{
    position: relative;
    overflow: hidden;
    margin: 8px;
    min-width: 340px;
    max-width: 480px;
    max-height: 290px;
    width: 100%;
    background-color: #000;
    border: solid;
    box-sizing: border-box;
    img{
        width: 100%;
        position: relative;
        top: 0;
        right: 0;
        opacity: 1;
        transition: 0.3s ease-in-out;
    }
    div{
        position: absolute;
        top: 0;
        left: -120px;
        width: 120px;
        height: 100%;
        padding: 8px 4px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        background-color: #000;
        transition: 0.3s ease-in-out;

        a{
            display: block;
            line-height: 2;
            color: #fff;
            text-decoration: none;
            opacity: 0.8;
            padding: 5px 15px;
            position: relative;
            transition: 0.3s ease-in-out;
            &:hover{
                text-decoration: underline;
            }
        }
    }
    &:hover{
        img{
            opacity: 0.5;
            right: -120px;
        }
        div{
            left: 0;
            opacity: 1;
        }
    }
}
</style>
